package com.webas.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.hibernate.annotations.NaturalId;

/**
 * 
 * @author tkhasano
 *
 */
@Entity
@Table(name = "softwiresites")
public class SoftwareSite
	implements com.webas.api.entity.Entity<SoftwareSite>
{
	static final long serialVersionUID = -3930968470907362935L;
	
	@Column(unique = true)
	@Id
	@GeneratedValue
    private Long id;

	@Column(unique = true)
	@NaturalId
	@NotNull
	@Size(min = 3, max = 50)
    private String name;
    
    @Column(unique = true)
    @NotNull
    @Size(min = 1, max = 255)
    private String location;

    public SoftwareSite() {
    	
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
		this.id = id;
	}
    
    public String getName() {
        return name;
    }

    public void setName(final String name) {
        this.name = name;
    }

    public String getLocation() {
		return location;
	}

	public void setLocation(final String location) {
		this.location = location;
	}

	public String getIdentifier() {
		return name + " - " + location;
	}
	
	public Class<SoftwareSite> getType() {
		return SoftwareSite.class;
	}
}